package com.square.service.member.provider.feign;

import com.baomidou.mybatisplus.extension.api.R;
import com.square.service.common.entity.member.po.User;
import com.square.service.member.provider.fallback.UserFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户消费Feign
 *
 * @author : 王苏
 * @since : 2021/4/20 15:18
 */
@Component
@FeignClient(name = "member", fallback = UserFeignFallback.class)
public interface UserFeign {
    /**
     * 通过用户名获取用户
     */
    @GetMapping("/rpc/user/getUserByUsername")
    R<?> getUserByUsername(@RequestParam("username") String username);
}
